﻿<?php
session_start();
if (!isset($_SESSION['lang']))
    $_SESSION['lang'] = "vn";
if (isset($_GET['lang']))
    $_SESSION['lang'] = $_GET['lang'];
if (!isset($_SESSION['role']))
    $_SESSION['role'] = "user";
if (isset($_GET['role']))
    $_SESSION['role'] = $_GET['role'];
include_once 'ConnectHelper.inc';
$lang = $_SESSION['lang'];
$role = $_SESSION['role'];
if (isset($_SESSION['isLogin'])) {
    $IsLogin = $_SESSION['isLogin'];
} else {
    $IsLogin = 0;
}
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="artwork.css" />
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="ShowTooltip.js"></script>

</head>

<body>
<div class="centerNav">
	<div class="topCenter">		
		<div class="topLogo">
			<a href="index.html"><img src="images/logo.png" id="logo" /></a>
		</div>
		<div class="topSearch">
			<form action="#search">
				<input id="searchInput" type="text" name="SearchName"/>
				<input id="searchSubmit" type="submit" value="" />
			</form>		
		</div>
		<div class="login">
		 <?php if ((isset($_SESSION['isLogin']) && $_SESSION['isLogin'] == 1) || isset($_COOKIE["TenNguoiDung"])) { ?>
                <form action="XuLyDangXuat.php" method="post" >
            <?php echo "<a class='textLogin' href='#' onclick='XemThongTin();'>" . $_COOKIE["TenNguoiDung"] . "</a>"; if ($lang == 'vn') {?>
                    <input class="button" type="submit" value="Đăng Xuất" />
            <?php } else { ?>
                    <input class="button" type="submit" value="Log Out" />
                </form>
        <?php }} else { ?>
			<div class="textLogin"><a href="#">Login</a></div>
			<form class="formLogin shadow" method="post" action="XuLyDangNhap.php">
				<br/><label for="UserName">Username: </label>
				<br/><input id="txtUserName" type="text" name="txtUserName"><br/>
				<br/><label for="Password">Password: </label>
				<br/><input id="txtPassword" type="password" name="txtPassword"><br/> 
				</br/><input type="checkbox" name="checkbox"> Remember<br/>
				<br/><input id="floginButton" class="button" value="Login" type=submit><br/>
				<br/><hr /><br/>
				<a href="#register">Đăng ký tài khoản ArtPio</a><br/><br/>
				<a href="#password">Quên mật khẩu ?</a><br/><br/>
			</form> 
			 <?php
            }
        ?>
		</div> 
		<div class="topNav">
			<ul class="topMenu">		
				<li><a href="index.php?lang=vn"><img alt="" src="Images/Vn.gif" width="30px" height="20px"/></a></li>
				<li><a href="index.php?lang=en"><img alt=""  src="images/En.gif"  width="30px" height="20px"/></a></li>
				<div id="shadow" class="opaqueLayer"> </div> 
				<div id="question" class="questionLayer"><?php include_once 'artist\TranVinh.php';?><input type="button" onclick="hideLayer();" value="Close" /></div> 
				<li><a href="#artist" onclick="showLayer();">Artist</a></li>
				<li><a href="#gallery">Gallery</a></li>
				<li><a href="#news">News</a></li>
				<li><a href="#about">About</a></li>
				<li><a href="#" onClick="Contact();"><?php if ($lang == 'vn') { ?> Liên Hệ <?php } else { ?> Contact <?php } ?></a></li>
			</ul>
		</div>
	</div>
</div>
<div class="centerNav">
	<div class="leftCenter">
		<ul class="leftMenu">		
		<?php $Result = Run_QueRy("CALL sp_menuSelect()");
			while ($row = mysql_fetch_array($Result)) {
			?>	
			<li><a href="#" onClick="HienThiDanhMuc('<?php echo $row[0]; ?>');"><?php if ($lang == 'vn') {echo $row[1];} else {echo $row[2];} ?></a></li><hr />
			<?php } ?>
			
		</ul>
	</div>
	<div id="mainContent"><div id="Result" ></div></div>
</div>
<div class="centerNav">	<div class="lineBreak"></div></div>
<div class="centerNav">
	<div class="bottomCenter fixBottom">
		<div class="bottomLink floatLeft"><a href="#facebook"><img src="icons/facebook.png"/></a></div>
		<div class="bottomLink floatLeft"><a href="#twitter"><img src="icons/twitter.png"/></a></div>
		<div class="bottomLink floatLeft"><a href="#zing"><img src="icons/zing.png"/></a></div>
		<div class="bottomLink floatRight"><a href="#zing"><img src="icons/home.png"/></a></div>
	</div>
</div>	
</body>
</html>